









package com.company.m1zhongjiezhemoshi.section1;

import java.util.Random;

/**
 * @author cbf4Life cbf4life@126.com
 * I'm glad to share my knowledge with you all.
 * ����
 */
public class Sale {

	
	
	public void sellIBMComputer(int number){
		
		Stock stock = new Stock();
		
		Purchase purchase = new Purchase();
			
		if(stock.getStockNumber()<number){  
			purchase.buyIBMcomputer(number);			
		}
		System.out.println(""+number+"̨");
		stock.decrease(number);
	}
	
	
	public int getSaleStatus(){
		Random rand = new Random(System.currentTimeMillis());
		int saleStatus = rand.nextInt(100);
		System.out.println(""+saleStatus);
		return saleStatus;
	}
	
	
	public void offSale(){
		
		Stock stock = new Stock();
		System.out.println("�ۼ�����IBM����"+stock.getStockNumber()+"̨");
	}
}